package com.lulin.mall.product.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Redisson相关配置
 *
 * @author lulin
 * @date 2022/11/21 11:03
 */
@Configuration
public class MyRedisConfig {
    @Bean
    public RedissonClient redissonClient() {
        Config config = new Config();
        //配置连接的信息——单机版的
        config.useSingleServer().setAddress("redis://192.168.110.8:6379");
        RedissonClient redissonClient = Redisson.create(config);

        return redissonClient;
    }
}
